package com.education.basic.resource;

import com.yunshangwoniu.core.utils.Logger;

/**
 * 学费
 */
public enum MajorFee 
{
	STGC_FEE("01",Major.STGC,3500D),
	SLSDGC_FEE("02",Major.SLSDGC,3500D),
	HJGC_FEE("03",Major.HJGC,3500D),
	JXGCJZDH_FEE("04",Major.JXGCJZDH,3500D),
	ZZJZDH_FEE("05",Major.ZZJZDH,3500D),
	CLGC_FEE("06",Major.CLGC,3500D),
	LCYX_FEE("07",Major.LCYX,3500D),
	JSJKXYJS_FEE("08",Major.JSJKXYJS,3500D),
	JSJRJ_FEE("09",Major.JSJRJ,3500D),
	DQGCJZDH_FEE("10",Major.DQGCJZDH,3500D),
	;
	private String code;
	private Major major;
	private double fee;
	
	private MajorFee(String code, Major major, double fee) 
	{
		this.code = code;
		this.major = major;
		this.fee = fee;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Major getMajor() {
		return major;
	}
	public void setMajor(Major major) {
		this.major = major;
	}
	public double getFee() {
		return fee;
	}
	public void setFee(double fee) {
		this.fee = fee;
	}
	
	/**
	 * 通过专业code 获得该专业的学费金额
	 * @param majorCode
	 * @return
	 */
	public static Double getMajorFee(String majorCode)
	{
		for(MajorFee majorFee : MajorFee.values())
		{
			if(majorFee.getMajor().getCode().equals(majorCode))
			{
				Logger.debug(MajorFee.class, String.format("get majorFee success when majorCode:%s;majorFree:", majorCode,majorFee.getFee()));
				return majorFee.getFee();
			}
		}
		Logger.debug(MajorFee.class, "get majorFee is fail");
		return 0D;
	}

}
